package com.sc.nft.entity.vo.ecology;

import com.sc.nft.enums.EcologyIncomeTypeEnum;
import com.sc.nft.enums.EcologyRewardsType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class HatchRecordsRewardsDetailsVO {

    @ApiModelProperty(value = "奖励类型 ECOLOGY_POINTS:生态积分 EQUITY_PROPS:权益道具")
    private EcologyRewardsType rewardsType;


    @ApiModelProperty(value = "奖励名称")
    private String linkName;

    @ApiModelProperty(value = "奖励数量")
    private String linkCount;

    @ApiModelProperty(value = "奖励图片")
    private String linkImge;

    public void setLinkCount(BigDecimal linkCount) {
        if(rewardsType == EcologyRewardsType.ECOLOGY_POINTS) {
            this.linkCount = linkCount.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
        }else {
            this.linkCount = linkCount.stripTrailingZeros().toPlainString();
        }

    }
}
